var chartDom = document.getElementById('guobuqingdan');
var myChart = echarts.init(chartDom, 'dark');
var option;

var option;

var dataBJ = [
    ["1年",8,8],
    ["2年",37,37],
    ["3年",60,60],
    ["4年",18,18],
    ["5年",7,7],
    ["6年",4,4],

];

var itemStyle = {
    opacity: 0.8,
    shadowBlur: 10,
    shadowOffsetX: 0,
    shadowOffsetY: 0,
    shadowColor: 'rgba(0,0,0,0.3)'
};

option = {
        graphic: [
        {
           type:"image",
           left:"5%",
           bottom:"89%",
           style: {
               image:"https://i.loli.net/2021/06/21/CvlGW8PErboK2YQ.png",
               width:"68",
               height:"45",
            }
         },
         {
           type:"image",
           left:"84%",
           bottom:"68%",
           style: {
               image:"https://i.loli.net/2021/06/20/PlYriL6m1DwkO2I.png",
               width:"50",
               height:"50",
            }
         },],
    backgroundColor:'rgb(0,21,46)',
      title: {
        text: '近两年公布的国补名录中，大量垃圾焚烧企业投产运营3年才获得补贴',
        left:'12%',
        top: '5%',
        textStyle: {
            fontSize:20,
            color:"#FFFFFF",
            fontFamily: "Microsoft YaHei",
               },
    },

    color: [
        '#dd4444', '#fec42c', '#80F1BE'
    ],
    grid: {
        left: '10%',
        right: 150,
        top: '30%',
        bottom: '8%'
    },
    tooltip: {
        show:"true",
    },
    xAxis: {
        type: 'category',
        name: '获补延迟年限',
        nameGap: 16,
        nameTextStyle: {
            fontSize: 14
        },
        data:["1年","2年","3年","4年","5年","6年"],
        splitLine: {
            show: false
        },
    },
    yAxis: {
        type: 'value',
        name: '企业数量',
        nameLocation: 'end',
        nameGap: 30,
        nameTextStyle: {
            fontSize: 14
        },
        max:"60",
        splitLine: {
            show: false
        }
    },
    visualMap: [
        {
            right: '5%',
            top: '20%',
            dimension: 1,
            min: 0,
            max: 60,
            itemWidth: 30,
            itemHeight: 120,
            calculable: true,
            precision: 0.1,
            text: ['企业数量'],
            textGap: 30,
            inRange: {
                symbolSize: [20, 85],
                color: ['rgba(242,146,104)', "rgba(136,226,226)"]
            },
            outOfRange: {
                symbolSize: [1, 60],
                color: ['rgba(255,255,255,0.4)']
            },
            controller: {
                inRange: {
                    color: ['rgba(242,146,104)',"rgba(136,226,226)"]
                    
                },
                outOfRange: {
                    color: ['#999']
                }
            }
        },
    ],
    series: [
        {
            name: '2020年纳入补贴目录',
            symbolSize: function (data) {
            return Math.sqrt(data[2]) / 5e2;
        },
        emphasis: {
            focus: 'series',
            label: {
                show: true,
                formatter: function (param) {
                    return param.data[3];
                },
                position: 'top'
            }
        },
            type: 'scatter',
            itemStyle: {
            shadowBlur: 10,
            shadowColor: 'rgba(120, 36, 50, 0.5)',
            shadowOffsetY: 5,
            color: new echarts.graphic.LinearGradient( 0, 0, 0, 1,[
                { offset: 0, color: 'rgba(136,226,226)' },
                { offset: 1, color: 'rgba(79,140,150)' }
                                           ])
        },
            data: dataBJ,
           color: 'rgba(136,226,226)'
        },
    ]
};
option && myChart.setOption(option);
